import { request } from '@/utils';

const getCourseListAPI = (token) => {
    return request({
        url:'/teacher/course',
        method:'GET',
        headers:{"Authorization": "Bearer " + token}
    })
}

const addCourseAPI = (data,token) => {
    return request({
        url:'/teacher/add_course',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })

}


const changeCourseInfoAPI = (data,token) => {
    return request({
        url:'/teacher/change_course',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const deleteCourseAPI = (class_id,token) => {
    return request({
        url:'/teacher/delete_course',
        method:'POST',
        data:{
            class_id
        },
        headers:{"Authorization": "Bearer " + token}
    })
}


const getPartListAPI = (class_id,token) => {
    return request({
        url:'/teacher/part_message',
        method:'POST',
        data:{
            class_id
        },
        headers:{"Authorization": "Bearer " + token}
    })
}


const getCourseCondition = (class_id,token) => {
    return request({
        url:'/teacher/class_message',
        method:'POST',
        data:{
            class_id
        },
        headers:{"Authorization": "Bearer " + token}
    })
}


const addPartAPI = (data,token) => {
    return request({
        url:'/teacher/add_part',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })

}

const changePartAPI = (data,token) => {
    return request({
        url:'/teacher/change_part',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })

}


const deletePartAPI = (data,token) => {
    return request({
        url:'/teacher/delete_part',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })

}

const getStudentList = (class_id,token) => {
    return request({
        url:'/teacher/get_students',
        method:'POST',
        data:{
            class_id
        },
        headers:{"Authorization": "Bearer " + token}
    })
}

const addStudentAPI = (data,token) => {
    return request({
        url:'/teacher/add_students',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })

}


const deleteStudentAPI = (data,token) => {
    return request({
        url:'/teacher/delete_students',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })

}


const getVideoListAPI = (class_id,token) => {
    return request({
        url:'/teacher/get_videos',
        method:'POST',
        data:{
            class_id
        },
        headers:{"Authorization": "Bearer " + token}
    })
}


const getVideoAPI = (data,token) => {
    return request({
        url:'/teacher/get_video',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token},
        responseType:'blob'
    })

}

const addVideoAPI = (data,token) => {
    return request({
        url:'/teacher/add_video',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const deleteVideoAPI = (data,token) => {
    return request({
        url:'/teacher/delete_videos',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}


const changeVideoInfoAPI = (data,token) => {
    return request({
        url:'/teacher/change_video',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const getTestsAPI = (data,token) => {
    return request({
        url:'/teacher/get_exercises',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}


const addTestsAPI = (data,token) => {
    return request({
        url:'/teacher/add_exercise',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const deleteTestsAPI = (data,token) => {
    return request({
        url:'/teacher/delete_exercise',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const changeTestInfoAPI = (data,token) => {
    return request({
        url:'/teacher/change_exercise',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const getInfoAPI = (token) => {
    return request({
        url:'/teacher_message',
        method:'GET',
        headers:{"Authorization": "Bearer " + token}
    })

}


const changeInfoAPI = (data,token) => {
    return request({
        url:'/teacher_messageChange',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}


const AIChatAPI = (question,token)=>{
    return request({
        url:'/teacher/ai',
        method:'POST',
        data:{
            question 
        },
        headers:{"Authorization": "Bearer " + token}
    })
}

export {
    getCourseListAPI,
    getCourseCondition,
    getPartListAPI,
    getInfoAPI,
    getStudentList,
    getTestsAPI,
    getVideoAPI,
    getVideoListAPI,
    addCourseAPI,
    addPartAPI,
    addStudentAPI,
    addTestsAPI,
    addVideoAPI,
    deleteCourseAPI,
    deletePartAPI,
    deleteStudentAPI,
    deleteTestsAPI,
    deleteVideoAPI,
    changeCourseInfoAPI,
    changePartAPI,
    changeTestInfoAPI,
    changeVideoInfoAPI,
    changeInfoAPI,
    AIChatAPI
}